import request from '@/utils/request'

// 获取本用户订单详细信息list
export function getUserOrdersInfo(status) {
  return request({
    'url': '/system/orders/ordersListByUserId/'+status,
    'method': 'get'
  })
}

// 根据id查询订单详细
export function getOrdersById(orderId) {
  return request({
    url: '/system/orders/' + orderId,
    method: 'get'
  })
}

// 编辑订单信息
export function updateOrders(data) {
  return request({
    url: '/system/orders/wxUserEditOrder',
    method: 'put',
    data: data
  })
}

// 取消订单
export function cancelOrders(orderId) {
  return request({
    url: '/system/orders/wxUserCancelOrder/' + orderId,
    method: 'get',
  })
}


// 配送人获取可接订单list
export function getDeliveryList() {
  return request({
    'url': '/system/orders/deliveryList',
    'method': 'get'
  })
}


// 配送人获取已接订单list
export function getReceivedList() {
  return request({
    'url': '/system/orders/receivedList',
    'method': 'get'
  })
}

// 配送人点击抢单
export function acceptOrder(id) {
  return request({
    'url': '/system/orders/acceptOrder/'+ id,
    'method': 'get'
  })
}

// 配送人点击取货
export function pickOrder(id) {
  return request({
    'url': '/system/orders/pickOrderByDelivery/'+ id,
    'method': 'get'
  })
}

// 配送人点击取货
export function finishOrder(id) {
  return request({
    'url': '/system/orders/finishOrder/'+ id,
    'method': 'get'
  })
}


// 食堂出餐查询所有新订单列表
export function listOrders(query) {
  return request({
    url: '/system/orders/newList',
    method: 'get',
    params: query
  })
}

// 食堂出餐查询所有新订单列表
export function orderReady(query) {
  return request({
    url: '/system/orders/orderReady',
    method: 'get',
    params: query
  })
}

// 食堂出餐接单
export function receiveOrder(id) {
  return request({
    url: '/system/orders/receiveOrder/' + id,
    method: 'get'
  })
}
// 食堂出餐 拒绝订单
export function refuseOrder(id) {
  return request({
    url: '/system/orders/refuseOrder/' + id,
    method: 'get'
  })
}
// 食堂出餐 拒绝订单
export function dispatchOrder(id) {
  return request({
    url: '/system/orders/dispatchOrder/' + id,
    method: 'get'
  })
}